import React from 'react'
import style from './index.module.scss';
import PropTypes from 'prop-types';

MyItem.propTypes = {
  itemClick: PropTypes.func.isRequired,
  myData: PropTypes.array.isRequired
}
MyItem.defaultProps = {
  myData: [
    {
      title: '全部',
      number: '20'
    },
    {
      title: '已报名',
      number: '20'
    },
    {
      title: '已录取',
      number: '20'
    },
    {
      title: '已完成',
      number: '20'
    }
  ]
}


export default function MyItem(props) {
    const { itemClick, myData } = props; 
    return (
      <div className={style.head_bottom}>
                <dl>
                  { myData.map((item,index) => {
                    return (
                      <dt key={index} onClick={() => {itemClick(item)}}>
                      <div className={style.number}>
                        {item.number}
                      </div>
                      <div className={style.text}>
                        {item.title}
                      </div>
                  </dt>
                    )
                  })}
                </dl>
              </div>
    )
}
